<template>
  <div class="login">
    <h2>登录页面</h2>
    <button @click="clickLogin">登录</button>
  </div>
</template>

<script setup>
  import { useRouter } from 'vue-router'
  const router = useRouter()
  function clickLogin() {
    console.log("点击了登录")
    // 向服务器发送请求,登录成功后,将token保存到本地
    localStorage.setItem("token", "1234567890")
    // 跳转到home页面
    router.push("/home")
  }

</script>

<style scoped>
</style>